package com.purplesoft.zettl.Utilities;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedPrefs {
	
	private Context context;

	public SharedPrefs(Context context) {
		this.context = context;
	}
	
    private static SharedPreferences getPrefs(Context context) {
        return context.getSharedPreferences("ZettlPreferences", 0);
    }

    public String getString(String key, String defaultValue) {
        return getPrefs(context).getString(key, defaultValue);
    }

    public int getInt(String key, int defaultValue) {
        return getPrefs(context).getInt(key, defaultValue);
    }

    public void setString(String key, String value) {
        // perform validation etc..
        getPrefs(context).edit().putString(key, value).commit();
    }

    public void setInt(String key, int value) {
        // perform validation etc..
        getPrefs(context).edit().putInt(key, value).commit();
    }

}
